import { JobStatus } from './type';
import { JobResultNotification, SimulationSpec, JobContext } from './type';

type Extra = JobContext

// interface JobDetail {
//   processId: number;
//   startedAt: number;
//   finishedAt: number;
//   executionTime: number;
//   exitCode: number;
//   exitMessage: string;
// }
export class SimulationJob {
  public id: string;
  public product: string;
  public definition: SimulationSpec;
  public extra: Extra;

  // public jobDetail: JobDetail;
  public status: JobStatus;
  public result: JobResultNotification;

  public processId: number;
  public startedAt: number;
  public finishedAt: number;
  public executionTime: number;
  public exitCode: number;
  public exitMessage: string;

  constructor(jobId: string, product: string, definition: SimulationSpec, extra: Extra) {
    this.id = jobId;
    this.product = product;
    this.definition = definition;
    this.extra = extra;
    this.status = JobStatus.Created;
  }
}